name_list = ["流川枫", "雏田","佐助", "纲手", "路飞", "柯南"]

# 查询
print(name_list[2])
# 查询指定元素的索引位置
print(name_list.index("路飞"))

# 追加
name_list.append("雏田")
name_list.append("鸣人")
print(name_list)

# 移除, 指定元素内容
name_list.remove("流川枫")
# 移除, 指定元素的位置 (返回值是被移除的内容)
print(name_list.pop(2))
print(name_list)

# 修改
name_list[2] = "工藤新一"
print(name_list)

# 排序 (原数组内容会被修改)
digit_list = [2, 5, 1, 3, 21, 14, 55, 32]
# digit_list.sort()             # 排序
digit_list.sort(reverse=True) # 倒序排列
print(digit_list)

ageList = [90,10,30,20,50,70]
# reverse 将列表进行反转
ageList.reverse()
print(ageList)

print("------------------------------")

students = [
    ['猪八戒', '沙悟净', '唐三葬'],
    ['白龙马', '白骨精']
]

print(students[1][1])
print(students[0][1])
print(students[1][4])  # IndexError: list index out of range
